/**
 * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

.cart-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.cart-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.3s ease;
}

.cart-button:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff4757;
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.cart-popover {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  max-height: 400px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.cart-header h3 {
  margin: 0;
  color: #333;
}

.cart-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6c757d;
}

.cart-items {
  overflow-y: auto;
  max-height: 280px;
  padding: 8px;
}

.cart-item {
  display: flex;
  padding: 10px;
  border-bottom: 1px solid #e9ecef;
  position: relative;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}

.cart-item-details {
  flex: 1;
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-name {
  font-weight: 500;
  margin-bottom: 4px;
  cursor: pointer;
  color: #333;
}

.cart-item-name:hover {
  color: #4CAF50;
}

.cart-item-price {
  font-weight: bold;
  color: #e63946;
}

.cart-item-quantity {
  font-size: 14px;
  color: #6c757d;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 18px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0 5px;
  border-radius: 50%;
}

.cart-item-remove:hover {
  background-color: #ffebee;
}

.cart-empty {
  padding: 30px 20px;
  text-align: center;
  color: #6c757d;
}

.cart-footer {
  padding: 12px 16px;
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.cart-total span {
  color: #e63946;
}

.cart-buttons {
  display: flex;
  gap: 10px;
}

.place-order-in-cart {
  width: 100%;
  padding: 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.place-order-in-cart:hover {
  background-color: #45a049;
}

.place-order-in-cart:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}